/*
 * @Author: lininghua 0027012803@iwhalecloud.com
 * @Date: 2022-06-14 14:28:31
 * @LastEditors: lininghua 0027012803@iwhalecloud.com
 * @LastEditTime: 2022-06-14 14:38:23
 * @FilePath: /flowplatform-fe-sf/src/components/flowdetailpannel/IsConfigCheckPoint.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, {Fragment} from "react";
import {Checkbox, Icon, Tooltip} from "antd";
import {connect} from "dva";
import {openNotificationWithIcon} from "utils/comm";
import BaseDuedateSetting from "./BaseDuedateSetting";
import styles from "./Pannel.less";

export const alertCodePattern = /^[a-zA-Z_][a-zA-Z_0-9-]*$/;

@connect(({FlowChart, notice_msg: noticeModel}) => ({
  noticeTypeData: FlowChart.noticeTypeData,
  noticeThemeTypeList: noticeModel.noticeThemeTypeList,
}))
class ChooseCandidateUserComment extends BaseDuedateSetting {
  constructor(props) {
    super(props);
    this.state = {};
    this.openNotificationWithIcon = openNotificationWithIcon.bind(this);
  }

  render() {
    const {codeRefModel} = this.props;
    const showCheck = codeRefModel?.model.properties?.isConfigCheckPoint;

    return (
      <>
        <div className={styles.content_item} style={{display: "block"}}>
          <span className={styles.item_label} style={{paddingBottom: 0}}>
            <Checkbox
              checked={showCheck === '1'}
              onChange={(e) => this.onConfigCheckPoint(e.target.checked)}
            >
              是否配置检查点
            </Checkbox>
            <Tooltip placement="topLeft" title="仅作节点配置，以configCheckPoint字段供前端使用">
              <Icon
                style={{cursor: "pointer"}}
                theme="filled"
                type="question-circle"
              />
            </Tooltip>
          </span>
        </div>
      </>
    );
  }
}

export default ChooseCandidateUserComment;
